var http = require('http')

var http_server = http.createServer();

http_server.on('request', function (request, response) {
	// console.log('接收到用户请求')
	// console.log(request.url)
	// response.end('hello http_server')

	response.setHeader('content-type', 'text/html;charset=utf-8')
	if (request.url == '/') response.end('this is 首页')
	else if (request.url == '/log') response.end('this is login')
	else response.end('404')

})
http_server.listen(8080, function () {
	console.log("服务器启动成功,http://localhost:8080")
})